package com.wh.custom.dao;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.wh.custom.pojo.CustomMycustom;
import com.wh.custom.vo.CustomExportVo;
import com.wh.order.pojo.OrderList;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.time.LocalDateTime;
import java.util.List;

/**
* 后端Service接口；
*/
@Mapper
@Repository
public interface CustomMycustomMapper extends BaseMapper<CustomMycustom> {
    /**
     * 分页：查询当前页数据
     * @param page 分页参数
     * @param queryWrapper 查询条件
     * @return
     */
    List<CustomMycustom> findByPage(@Param("page") IPage<CustomMycustom> page,@Param("ew") QueryWrapper<CustomMycustom> queryWrapper);

    void allocation(Long id, Long salesmanId);

    //根据类型查询
    //@Select("SELECT id FROM t_custom_customertype WHERE customer_type LIKE CONCAT('%', #{keyword}, '%')")
    Long selectTypeIdByTypeName(@Param("keyword") Object keyword);

    //根据来源查询
    // @Select("SELECT id FROM t_custom_customersource WHERE customer_source LIKE CONCAT('%', #{keyword}, '%')")
    Long selectTypeIdBySourceName(@Param("keyword") Object keyword);

    //根据标签查询
    //@Select("SELECT id FROM t_custom_customerlabel WHERE customer_label LIKE CONCAT('%', #{keyword}, '%')")
    Long selectTypeIdByLabelName(@Param("keyword") Object keyword);


    String findphone(String phoneNumber);
//领取客户
    void receiver(Long id, Long salesmanId);
//放回公海
    void recovery(Long id);

    List<CustomMycustom> selectmycustomer(Long salesmanId);

    Long findIdByphoneNumber(String phoneNumber);

    Long phoneValidation(String phone, String companyName);

    List<CustomMycustom> getCustomDataByNowYear(String year);

    List<CustomMycustom> getCustomDataByNowMonth(String currentYearMonth);

    List<CustomMycustom> getCustomDataByNowWeek();

    List<CustomExportVo> findAllExportOrder(String[] idArr);

    Long selectSaleamnId(Integer customerId);

    void updateTime(LocalDateTime dateTime, Long customId);

    void topOrDown(Integer id, Integer top);

    void personalTopOrDown(Integer id, Integer personalTop);
}


